import React, { FC, useContext } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { ActivitiesItemContext } from '@/pages/MyActivities/ActivitiesList/ActivitiesItem/ActivitiesItemContext';
import {TimeFormat} from '../TimeFormat'
export interface IProps extends ICompProps {}
FooterTime.defaultProps = {} as Partial<IProps>;
function FooterTime(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('FooterTime', className);
    const { endTime,startTime } = useContext(ActivitiesItemContext);
    const localStart = TimeFormat(startTime);
    const localEnd = TimeFormat(endTime);
    return (
        <RootView className={localClassName} style={style}>
            活动时间：{localStart}～{localEnd}
        </RootView>
    );
}
export default React.memo(FooterTime as FC<IProps>);
const RootView = styled(View)`
    &.FooterTime {
        font-size: 24px;
        font-weight: 400;
        color: #808a9d;
    }
`;
